package com.egoo.ticket.server.dao;

import com.egoo.ticket.server.pojo.entity.EwsDepartment;
import com.egoo.ticket.server.pojo.vo.EwsDepartmentVo;
import com.egoo.ticket.server.pojo.vo.InteractiveDataVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@Component
public interface EwsDepartmentDao {

	/**
	 * TODO
	 * @param tenantId
	 * @return
	 */
	List<InteractiveDataVo> selectDepartmentTreeList(@Param("tenantId") String tenantId);

	/**
	 * TODO
	 * @param searchMap
	 * @return
	 */
	List<InteractiveDataVo> selectInteractiveListByCondition(Map<String, Object> searchMap);

	/**
	 * TODO
	 * @param searchMap
	 * @return
	 */
	List<EwsDepartmentVo> selectDepartmentListByCondition(Map<String, Object> searchMap);

	/**
	 * TODO
	 * @param id
	 * @return
	 */
    int deleteByPrimaryKey(@Param("id") String id,
						   @Param("tenantId") String tenantId);

	/**
	 * TODO
	 * @return
	 * @param tenantId
	 */
	int deleteAllDept(@Param("tenantId") String tenantId);

	/**
	 * TODO
	 * @param ewsDepartments
	 * @return
	 */
	Long insertBatch(@Param("ewsDepartments") List<EwsDepartment> ewsDepartments);

	/**
	 * TODO
	 * @param record
	 * @return
	 */
    int insert(EwsDepartment record);

	/**
	 * TODO
	 * @param record
	 * @return
	 */
	int insertSelective(EwsDepartment record);

	/**
	 * TODO: 未进行租户过滤，在已交付的项目中被使用，
	 * 		开发新功能时建议使用此方法(selectByPrimaryKeyAndTenantId())
	 * @param id
	 * @return
	 */
	@Deprecated
    EwsDepartmentVo selectByPrimaryKey(String id);

	/**
	 * 查询部门
	 * @param id
	 * @param tenantId
	 * @return
	 */
	EwsDepartmentVo selectByPrimaryKeyAndTenantId(@Param("id") String id,
												  @Param("tenantId") String tenantId);

	/**
	 * TODO
	 * @param record
	 * @return
	 */
	int updateByPrimaryKeySelective(EwsDepartment record);

	/**
	 * TODO
	 * @param record
	 * @return
	 */
    int updateByPrimaryKey(EwsDepartment record);

    /**
     * @param pid:
     * @return: com.egoo.ticket.server.pojo.vo.EwsDepartmentVo
     * @author: xu
     * @date: 2020/11/9 13:26
     * @description:
     */

	EwsDepartmentVo selectByPid(@Param("pid") String pid,
								@Param("tenantId") String tenantId);

	Integer delete(Map<String, Object> map);


	Long updateBatch(List<EwsDepartment> deptData);
}